package shangke;
public class day3 extends Thread{
    @Override
    public void run() {
    }
    public static void main(String[]args){
        System.out.println("显示默认优先级");
        //创建线程
        day3 day3=new day3();
        //启动线程
        day3.start();
        System.out.println("主线程的名字:"+Thread.currentThread().getName()+"\t"+"优先级:"+Thread.currentThread().getPriority());
        System.out.println("子线程的名字:"+day3.getName()+"\t"+"优先级"+day3.getPriority());
        System.out.println("修改显示默认优先级");
        Thread.currentThread().setPriority(10);
        System.out.println("主线程的名字:"+Thread.currentThread().getName()+"\t"+"优先级:"+Thread.currentThread().getPriority());
        day3.setPriority(8);
        System.out.println("子线程的名字:"+day3.getName()+"\t"+"优先级:"+day3.getPriority());
    }
}